﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Model
{
    public delegate bool MessageProcess(Message msg);

    public class Processor
    {
        public MessageTypeEnum MessageType { get; private set; }
        public string Name { get; set; }
        public MessageProcess Process { get; set; }
        public bool RemoveWhenProcessed { get; set; }

        public Processor(string name)
        {
            Name = name;
        }

        public Processor(string name, MessageTypeEnum type)
        {
            Name = name; MessageType = type;
        }

        public Processor(string name, MessageTypeEnum type, MessageProcess process)
        {
            Name = name;
            Process = process;
            MessageType = type;
        }

        public Processor(string name, MessageTypeEnum type, MessageProcess process, bool removeWhenProcessed)
            : this(name, type, process)
        {
            this.RemoveWhenProcessed = removeWhenProcessed;
        }
    }
}
